import request from "@/utils/service.js";

//获取物业所有数据
export let shoufei = (ownerName) => {
    return request({
        url: "/property/findAll",
        method: "GET",
        params:{
            ownerName
        }
    })
}
//获取水费所有数据
export let waterfee = (ownerName) => {
    return request({
        url: "waterfee/findAll",
        method: "GET",
        params:{
            ownerName
        }
    })
}


//添加物业信息
export let addwuye = (ownId,createTime,houseNum,feePerson,fee,ownerName,houseId) => {
    return request({
        url: "/property/add",
        method: "POST",
        data: {
            ownId,createTime,houseNum,feePerson,fee,ownerName,houseId
        }
    })
}

//添加水费信息
export let addwater = (ownId,createTime,houseNum,feePerson,waterfee,ownerName,houseId) => {
    return request({
        url: "/waterfee/add",
        method: "POST",
        data: {
            ownId,createTime,houseNum,feePerson,waterfee,ownerName,houseId
        }
    })
}


// 删除物业数据
export let del = (id) => {
    return request({
        url: "/property/delete/" + id,
        method: "DELETE",
    })
}
// 删除水费数据
export let delwater = (id) => {
    return request({
        url: "/waterfee/delete/" + id,
        method: "DELETE",
    })
}

//查询物业所有单元
export let findAllHouse = () => {
    return request({
        url: "/property/findAllHouse",
        method: "GET"
    })
}


//查询水费所有单元
export let findWaterAllHouse = () => {
    return request({
        url: "/waterfee/findAllHouse",
        method: "GET"
    })
}

//查询对应单元业主信息

export let findOwnerByHouseId = (house) => {
    return request({
        url: "/property/findOwnerByHouseId",
        method: "GET",
        params:{
            house
        }
    })
}

//查询对应单元业主水费信息

export let findOwnerWaterByHouseId = (house) => {
    return request({
        url: "/waterfee/findOwnerByHouseId",
        method: "GET",
        params:{
            house
        }
    })
}

//充值物业缴费

export let pay = (fee,id) => {
    return request({
        url: "/property/pay",
        method: "POST",
        data: {
            fee,id
        }
    })
}

//充值水费缴费

export let paywater = (waterfee,id) => {
    return request({
        url: "/waterfee/pay",
        method: "POST",
        data: {
            waterfee,id
        }
    })
}



